<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html">
    <h:head>
        <title>Login</title>
    </h:head>
    <h:body>
        <h:panelGroup rendered="#{loginBean.loginOk eq false}">
            <center><h1>Por favor, faça login primeiro.</h1></center>

            <center>
                <h:form>
                    <h:panelGrid columns="2">

                        <h:outputLabel value="Nick name" for="nickName"/>

                        <h:inputText id="nickName" value="#{loginBean.nickName}"/>

                        <h:outputLabel value="Password" for="password"/>

                        <h:inputSecret id="password" value="#{loginBean.password}"/>

                    </h:panelGrid>

                    <h:commandButton value="Login" action="#{loginBean.validateLogin}"/>

                </h:form>
            </center>
        </h:panelGroup>
        <h:panelGroup rendered="#{loginBean.loginOk eq true}">
            <center><h1>Você ja esta logado.</h1></center>
        </h:panelGroup>
    </h:body>
</html>

